-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Use timezone.utc instead of UTC #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| cl.user_session.set("project_id", project_id) | ||
|
|
||
| # get lang_code from the copilot and store it in the session | ||
| lang_code = await self.call_copilot("getLangCode", default="en") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this returned a None object at the start of chat or something like that, so that lang_code was None
rdmo_chatbot/chatbot/adapter.py
Outdated
| if store.has_history(user.identifier, project_id): | ||
| content = getattr(config, f"CONTINUATION_{lang_code.upper()}", "") | ||
| await cl.Message(content=content).send() | ||
| history = store.get_history(user.identifier, project_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added here the chat history to the messages below this continuation message. Added it as a feature here but would make sense right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this, I am not sure. I need to check how it looks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, to be able to see it at least, but it may also get too long..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only shows at hover over, and there must be a way to change the icons right?
| subject: subjectInput.value, | ||
| message: messageInput.value | ||
| } | ||
| $(submitButton).off('click').on('click', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the submit button for send email was hanging(didn't do anything) for me at some point.
jochenklar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we talk about the changes later this week, I also implemented the other things we discussed, so this needs a rebase.
README.md
Outdated
|
|
||
| MIDDLEWARE.append('rdmo_chatbot.plugin.middleware.ChatbotMiddleware') | ||
|
|
||
| # Address of the Chainlit server serving the copilot widget. Provide an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that will work since the cookie with chatbot_token will hot work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I thought it worked before but I actually get this in the deployment
Error: Unauthorized
vce https:/.../chatbot/copilot/index.js:376
so it probably doesn't work..
rdmo_chatbot/chatbot/adapter.py
Outdated
|
|
||
| try: | ||
| result = await cl.CopilotFunction(name=name, args=kwargs).acall() | ||
| except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good pattern, was there a specific reason to add this? I am ok with the args -> kwargs, although now it is confusing in a different way.
rdmo_chatbot/chatbot/adapter.py
Outdated
| return response_message | ||
|
|
||
| async def send_history(self, history, user): | ||
| assistant_name = getattr(config, "ASSISTANT_NAME", "Assistant") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use config.ASSISTANT_NAME there should be a default.
rdmo_chatbot/chatbot/adapter.py
Outdated
| if store.has_history(user.identifier, project_id): | ||
| content = getattr(config, f"CONTINUATION_{lang_code.upper()}", "") | ||
| await cl.Message(content=content).send() | ||
| history = store.get_history(user.identifier, project_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this, I am not sure. I need to check how it looks.
| height: 2em; | ||
| } | ||
|
|
||
| .sr-only { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
| return string.length > maxLength ? string.slice(0, maxLength) + '…' : string; | ||
| } | ||
|
|
||
| const getCookie = (name) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed Cookies is in the window object now.
|
|
||
| $(contactModal).modal('hide') | ||
| $(contactModal).modal('hide') | ||
| } catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed or is this just ChatGPT boilerplate?
| const shadow = copilot.shadowRoot | ||
| const observedShadows = new WeakSet() | ||
|
|
||
| const ensureDialogAccessibility = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the file needs refactoring or at least a reason why it is needed. This is just AI code.
| <script src="{{ settings.CHATBOT_URL }}/copilot/index.js"></script> | ||
| <script src="{% static 'chatbot/js/copilot.js' %}"></script> | ||
| <script> | ||
| const configuredChatbotUrl = "{{ settings.CHATBOT_URL }}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to set a relative url path for CHATBOT_URL = "/chatbot" and got an error in JS Failed to construct 'URL': Invalid URL but now I can't seem to reproduce this error so i'll revert it again..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All but this change should be a different PR 🥴.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IKR 😜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now Ive minimized the changes and only made 2 commits
Signed-off-by: David Wallace <[email protected]>
Signed-off-by: David Wallace <[email protected]>
jochenklar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, we need to fix the messages part.

I got an error
cannot import name 'UTC' from 'datetimewith py310